//#include<iostream>
//using namespace std;
//typedef struct A
//{
//	int _a;
//	int _sum;
//}A;
//int main()
//{
//	A a = { 1,10 };
//	A* const p = &a;
//	p->_a = 2;
//	p->_sum = 3;
//	const A* p1 = &a;
//	p1->_a = 1;
//	p1->_sum = 10;
//	return 0;
//}
#include<iostream>
using namespace std;
class A
{
public:
	void foo()
	{
		cout << "foo()" << endl;
	}
	virtual void func1(int val = 1)
	{
		cout << "A->func1() : " << val << endl;
	}
	virtual void func2()
	{
		cout << "A::func2()" << endl;
	}
	void func3()
	{
		cout << "A::func3()" << endl;
	}
	virtual ~A()
	{
		cout << "~A()" << endl;
	}
	A(int a = 10)
		:_a(a)
	{
		cout << "A()" << endl;
	}
private:
	int _a;
};
class B : public A
{
public:
	B(int b = 20)
		:_b(b)
	{
		cout << "B()" << endl;
	}
	void foo()
	{
		cout << "foo()" << endl;
	}
	virtual void func1(int val = 2)
	{
		cout << "B->func1() : " << val << endl;
	}
	virtual void func2()
	{
		cout << "B::func2()" << endl;
	}
	virtual void func3()
	{
		cout << "B::func3()" << endl;
	}
	virtual ~B()
	{
		cout << "~B()" << endl;
	}
private:
	int _b;
};
class C : public B, public A
{
public:
	C(int c = 20)
		:_c(c)
	{
		cout << "C()" << endl;
	}
	void foo()
	{
		cout << "foo()" << endl;
	}
	virtual void func1(int val = 3)
	{
		cout << "C->func1() : " << val << endl;
	}
	virtual void func2()
	{
		cout << "C::func2()" << endl;
	}
	virtual void func3()
	{
		cout << "C::func3()" << endl;
	}
	virtual ~C()
	{
		cout << "~C()" << endl;
	}
private:
	int _c;
};
int main()
{
	/*C c(1);
	c.foo();*/
	A* pa = new C;
	pa->foo();
	pa->func1();
	pa->func2();
	pa->func3();
	return 0;
}